{template '_header'}

<div class="page-header">当前位置：<span class="text-primary">【{$name}】 的佣金明细</span></div>

<div class="page-content">
<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="mx_shop" />
    <input type="hidden" name="do" value="web" />
    <input type="hidden" name="r" value="sorder.commission.commlog" />
    <input type="hidden" name="id" value="{$id}" />

    <div class="page-toolbar ">
        <div class="col-sm-3">
            <div class="btn-group btn-group-sm" style='float:left'>
                <a class="btn btn-default" href="{php echo webUrl('sorder/commission')}">返回列表</a>
                <button class="btn btn-default btn-sm"  type="button" data-toggle='refresh'><i class='fa fa-refresh'></i></button>
                <!--累计佣金: <span class='text-danger'>{php echo number_format($commission['total'],2)}</span> &nbsp;-->
                <!--剩余佣金: <span class='text-danger'>{php echo number_format($commission['remain'],2)}</span> &nbsp;-->
                <!--提现佣金: <span class='text-danger'>{php echo number_format($commission['drawal'],2)}</span> &nbsp;-->
                <!--冻结佣金: <span class='text-danger'>{php echo number_format($commission['freeze'],2)}</span>-->
            </div>
        </div>

        <div class="col-sm-4 pull-right">
            <div class="input-group">
                <div class="input-group-select">
                    <select name='searchtime'  class='form-control  input-sm select-md'   style="width:120px;padding:0 5px;"  >
                        <option value=''>不按时间</option>
                        <option value='create' {if $_GPC['searchtime']=='create'}selected{/if}>获得/提现佣金时间</option>
                    </select>

                    {php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
                </div>
            </div>
        </div>

        <div class="col-sm-4 pull-right">
            <div class="input-group">
                <div class="input-group-select">
                    <select name='searchfield' class='form-control  input-sm select-md' style="width:100px;"  >
                        <option value="ordersn" {if $_GPC['searchfield']=='ordersn'}selected{/if}>订单号</option>
                    </select>
                </div>
                <input type="text" class="form-control input-sm"  name="keyword" value="{$_GPC['keyword']}" placeholder="请输入关键词"/>
                <span class="input-group-btn">
                    <button class="btn btn-sm btn-primary" type="submit"> 搜索</button>
                </span>
            </div>
        </div>
    </div>
</form>
{if !empty($list)}

<table class="table table-hover table-responsive">
    <thead class="navbar-inner" >
    <tr style='background:#f8f8f8'>
        <td style='width:200px;border-left:1px solid #f2f2f2;'>订单号</td>
        <td style='width:100px;text-align: center;'>买家</td>
        <td style='width:80px;text-align: right;;'>订单金额(元)</td>
        <td  style='width:80px;text-align: center;'>佣金(元)</td>
        <td  style='width:80px;text-align: center;'>所占分红</td>
        <td  style='width:80px;text-align: center;'>佣金类型</td>
        <td  style='width:80px;text-align: center;'>收入/支出</td>
        <td style='width:100px;text-align: center;'>时间</td>
    </tr>
    </thead>
    <tbody>
    {loop $list $item}
    <tr class='trbody'>
            <td>{$item['ordersn']}</td>
            <td style="text-align: center;">{$item['realname']}</td>
            <td style="text-align: center;">{$item['realprice']}</td>
            <td style="text-align: center;">{$item['money']}</td>
            <td style="text-align: center;">{$item['ratio']}%</td>
            <td style="text-align: center;">{$level[$item['level']]}</td>
            <td style="text-align: center;">{if $item['type']==1}收入{else}支出{/if}</td>
            <td style="text-align: center;">{php echo date('Y-m-d',$item['createtime'])}<br/>{php echo date('H:i:s',$item['createtime'])}</td>
    </tr>

    <tr style=";border-bottom:none;background:#f9f9f9;">
        <td colspan="4" style="text-align:left">
        </td>
        <td colspan="4" style="text-align:right">
        </td>
    </tr>
    {/loop}
    </tbody>
</table>
{$pager}

    {else}
    <div class="panel panel-default">
        <div class="panel-body empty-data">未查询到相关数据</div>
    </div>
    {/if}
</div>

{template '_footer'}